package com.polaris.live.adapter

import android.view.View
import com.blankj.utilcode.util.StringUtils
import com.polaris.live.common.adapter.BaseBindingAdapter
import com.polaris.live.common.adapter.VBViewHolder
import com.polaris.live.databinding.AdapterSignInRewardItemBinding
import com.polaris.live.resp.back_resp.UserPartyGameTask
import com.polaris.live.translation.R.string

/**
 * SignInRewardAdapter
 *
 * @author Created by 半仙 on 2024/3/15/015 15:43
 */
class SignInRewardAdapter :
    BaseBindingAdapter<AdapterSignInRewardItemBinding, UserPartyGameTask>() {
    override fun convert(
        holder: VBViewHolder<AdapterSignInRewardItemBinding>,
        item: UserPartyGameTask,
    ) {
        holder.vb.apply {
            tvSignDay.text = StringUtils.getString(string.how_days, item.days + 1)
            tvCoinNum.text = "${item.rewardGameCoin}"
            if (item.received) {
                llRewardReceived.visibility = View.VISIBLE
            } else {
                llRewardReceived.visibility = View.GONE
            }
        }
    }

}